1. Field of the Invention
The present invention relates to a technology of generating a graphics command and, more particularly, to a technology of generating a graphics command from an intermediate command.
2. Description of the Related Art
High-quality graphics are extensively used now as personal computers and gaming devices are used to run applications like games and simulations that use high-quality three-dimensional graphics and to play back image content in which actual footage and computer graphics are blended.
Generally, graphics processing is performed by using a CPU and a graphics processing unit coordinated with each other. A CPU is a general-purpose processor capable of general purpose computation, while a GPU is a special-purpose processor for advanced graphics computation. A CPU performs geometric computation such as projection transformation based on a three-dimensional model of an object. A GPU receives vertex data etc., from a CPU and performs rendering accordingly. A GPU comprises special-purpose hardware such as a rasterizer and a pixel shader and performs graphics processing using a pipeline process. In some recent GPUs, the shader capability is programmable as exemplified by a program shader. In general, a graphics library is provided to support shader programming.
To render an object, the CPU needs to generate a graphics command executed by the hardware of the GPU and deliver the generated command to the GPU. Generation of a graphics command requires much CPU time. This is sometimes addressed by introducing an intermediate command and dividing the process of generating a graphics command into two stages including generation of a intermediate command and conversion from the intermediate command to the graphics command. By executing generation of an intermediate command and conversion from the intermediate command to a graphics command in separate threads, it is possible to execute in parallel the process of generating an intermediate command and then converting the intermediate command into a graphics command, and processes other than graphics processing such as physical model computation for rendering subsequent frames. As a result of that, the CPU utilization can be improved.
[patent document 1] JP2008-123520
However, conversion from a plurality of intermediate commands into graphics commands may result in the same graphics command being repeatedly executed in spite of the fact that the state remains unchanged in a sequence of generated graphics commands. Due to this redundancy, the efficiency of execution is lowered.